package com.wkbb.basic.feign;

import com.wkbb.common.constants.VersionConstant;
import com.wkbb.common.dto.ResultDTO;
import com.wkbb.common.dto.basic.OrganizationDto;
import com.wkbb.common.dto.wx.AccountDto;
import com.wkbb.common.dto.wx.AccountInfoDto;
import com.wkbb.common.dto.wx.CpUserOpenDto;
import com.wkbb.common.dto.wx.WechatKfMessageDto;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "wkbb-wx-service")
public interface WxFeignService {

    @ApiOperation(value = "获取机构账户信息")
    @RequestMapping(value = "/wx/v1/wxthird/getAccount", method = RequestMethod.GET)
    ResultDTO<AccountDto> getAccount(@ApiParam(value = "accountId", required = true) @RequestParam(name = "accountId") Long accountId);

    @ApiOperation(value = "根据机构获取账户")
    @RequestMapping(value = "/wx/v1/wxthird/getAccountByOrg", method = RequestMethod.GET)
    ResultDTO<AccountDto> getAccountByOrg(@ApiParam(value = "orgId", required = true) @RequestParam(name = "orgId") Long orgId);

    @ApiOperation(value = "新增机构账户信息")
    @RequestMapping(value = "/wx/v1/account/addAccount", method = RequestMethod.POST)
    public ResultDTO addAccount(@ApiParam(value = "账户信息", required = true) @RequestBody AccountDto accountDto);

    @ApiOperation(value = "同步修改账户组织名称")
    @RequestMapping(value = "/wx/v1/account/updateAccountOrgInfo", method = RequestMethod.POST)
    public ResultDTO updateAccountOrgInfo(@ApiParam(value = "学校信息", required = true) @RequestBody OrganizationDto organizationDto);

    @ApiOperation(value = "获取机构账户列表")
    @RequestMapping(value = "/wx/v1/account/getAccountInfoList", method = RequestMethod.GET)
    public ResultDTO<List<AccountInfoDto>> getAccountInfoList(@ApiParam(value = "组织ID（用;分隔）", required = true) @RequestParam(name = "orgIds", required = true) String orgIds);

    @ApiOperation(value = "微信客服消息推送")
    @RequestMapping(value = "/wx/v1/msg/sendWxKfMsg", method = RequestMethod.POST)
    public ResultDTO sendWxKfMsg(@ApiParam(value = "信息", required = true) @RequestBody WechatKfMessageDto wechatKfMessageDto);

    @ApiOperation(value = "查询企微用户OPEN信息")
    @RequestMapping(value = "/wx/v1/cp/getCpUserOpen", method = RequestMethod.GET)
    public ResultDTO<CpUserOpenDto> getCpUserOpen(
            @ApiParam(value = "学校ID", required = true) @RequestParam(name = "corpId", required = true) String corpId,
            @ApiParam(value = "cpUserId", required = true) @RequestParam(name = "cpUserId", required = true) String cpUserId);

}
